#ifndef RECTANGLE_H
#define RECTANGLE_H

#include "Shape.h"

#include <cmath>

class Circle;

//Rectangular collision shape, aligned along the x and y-axis
class Rectangle: public Shape{
private:
    double width_, height_;

    const bool overlaps(const Rectangle* r) const;
    const bool overlaps(const Circle* c) const;
protected:
    Rectangle(const Point2& pos, const double& width, const double& height);
public:
    static Rectangle* getInstance(const Point2& pos, const double& width, const double& height);

    const bool contains(const Point2& p) const;
    const bool overlaps(const Shape* other) const;

    double getArea() const;
    
    const Rectangle* boundingRect() const;
    const Circle* boundingCircle() const;

    const double& getWidth() const;
    const double& getHeight() const;

    const Point2 topLeft() const;
    const Point2 topRight() const;
    const Point2 bottomLeft() const;
    const Point2 bottomRight() const;
};

std::ostream& operator<<(std::ostream& os, const Rectangle& r);


#endif
